﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="GetOpenid.aspx.cs" Inherits="GetOpenid" %>


<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <title>补全身份信息</title>
    <%--layui--%>
    <link href="../../layui/css/layui.css" rel="stylesheet" />
    <script src="../../layui/layui.js"></script>

    <script src="../../Scripts/jquery-1.8.0.min.js"></script>
    <script src="../../Scripts/jquery.form.js"></script>
    <style>
        .f_red {
            position: absolute;
            right: 50px;
            color: #dd4b39;
            top: 10px;
        }

        .f_red1 {
            position: absolute;
            right: 78px;
            color: #dd4b39;
            top: 10px;
        }

        .mr_tips {
            font-size: 14px;
            padding: 2px 48px 17px;
            color: red;
        }
    </style>
</head>
<body>
    <form class="layui-form" action="" id="AddForm" style="padding-right: 10px; padding-top: 10px;" enctype="multipart/form-data" method="post">
       <%=openid %>
    </form>

    <script>

        //表单提交完成
        function showResponse(data, status) {
            if (data.status == 1) {
                layer.msg(data.info, {
                    time: 1000 //2秒关闭（如果不配置，默认是3秒）
                }, function () {
                    window.location.href = "Login.aspx";
                });

            }
            else {
                layer.msg(data.info, {
                    time: 1000 //2秒关闭（如果不配置，默认是3秒）
                });
            }
        }



        //Demo
        layui.use('form', function () {


            var form = layui.form();


            form.on('radio(go)', function (data) {
                if (data.value == 0) {
                    $("#cardid").hide();
                    $("#PatientID").hide();
                    $("#WorkID").show();
                    $("#password").show();

                    $("#identitys").attr("lay-verify", "null");
                    $("#PatientIDs").attr("lay-verify", "null");
                    $("#WorkIDs").attr("lay-verify", "required");
                    $("#passwords").attr("lay-verify", "required");

                } else {
                    $("#cardid").show();
                    $("#PatientID").show();
                    $("#WorkID").hide();
                    $("#password").hide();

                    $("#identitys").attr("lay-verify", "identity");
                    $("#PatientIDs").attr("lay-verify", "required");
                    $("#WorkIDs").attr("lay-verify", "null");
                    $("#passwords").attr("lay-verify", "null");
                }

            });

            //监听提交
            form.on('submit(formDemo)', function (data) {
                var dialCheckResult = $("input:radio[name='Work']:checked").val();
                var option = {
                    dataType: 'json',
                    url: '/Handler/CommunityHandler.ashx?Action=AddUserInfo&openid=<%=openid %>&type=' + dialCheckResult,
                    success: showResponse
                };
                $('#AddForm').ajaxForm(option);
            });

        });


        $(function () {
            $(":radio[name='Work'][value='" + 0 + "']").prop("checked", "checked");
        })


    </script>
</body>
</html>




